package com.gupao.vip;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

/**
 * Created by 17082655 on 2019/1/5.
 * 自定义属性
 * 如果属性重复，会优先区application.properties中属性
 */
@Component
@PropertySource("classpath:my.properties")
@ConfigurationProperties(prefix = "my")
public class MyProperty {
	private String name;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Override
	public String toString() {
		return "MyProperty{" +
				"name='" + name + '\'' +
				'}';
	}

}
